package com.fbee.smartcommunities.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.fbee.smartcommunities.core.Base;
import java.io.Serializable;
import java.time.LocalDateTime;

import javafx.beans.binding.DoubleExpression;
import lombok.*;

/**
 * <p>
 * 购物车
 * </p>
 *
 * @author 汪佳泉
 * @since 2024-08-26
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@ToString
public class Cart extends Base {

    private static final long serialVersionUID = 1L;

    /**
     * 商品id
     */
    private Long goodsId;

    /**
     * 用户id
     */
    private Long userId;

    /**
     * 商品数量
     */
    private Integer count;

    /**
     * 加入时间
     */
    private LocalDateTime createTime;

    /**
     * 商品所属店铺
     */
    @TableField(exist = false)
    private String shopName;

    /**
     * 商品描述
     */
    @TableField(exist = false)
    private String description;

    /**
     * 商品价格
     */
    @TableField(exist = false)
    private Double price;

    /**
     * 商品图片
     */
    @TableField(exist = false)
    private String imgs;

    /**
     * 商品是否被选择，初始状态没有被选
     */
    @TableField(exist = false)
    Boolean isSelected = false;

    /**
     * 商品当前前库存
     */
    @TableField(exist = false)
    private Integer store;

    /**
     * 是否在订单之中
     */
    private boolean state;

    public Cart(Long goodsId, Long userId, Integer count, LocalDateTime createTime) {
        this.goodsId = goodsId;
        this.userId = userId;
        this.count = count;
        this.createTime = createTime;
    }

    public Cart(Long goodsId, Long userId, Integer count, LocalDateTime createTime, String shopName, String description, Double price, String imgs,Integer store) {
        this.goodsId = goodsId;
        this.userId = userId;
        this.count = count;
        this.createTime = createTime;
        this.shopName = shopName;
        this.description = description;
        this.price = price;
        this.imgs = imgs;
        this.store = store;
    }

}
